package com.summer.study.leetcode.algorithm;

import com.summer.study.leetcode.simple_class.ListNode;
import com.summer.study.leetcode.simple_class.SinglyLinkedList;

/**
 * @auther: 杨杰
 * @date: 2019/7/26 14:49
 * @description: 反转链表
 */
public class reverse_linked_list_206 {


    public static void main(String[] args) {
        SinglyLinkedList list = new SinglyLinkedList<Integer>();
        System.out.println("开始插入元素");
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        list.add(null);
        System.out.println("结束插入元素,开始遍历");
        list.transfer();
        System.out.println("结束遍历，开始反转");
        list.reverseList(list.head);
        System.out.println("结束反转，再次遍历");
        list.transfer2();
    }


}
